<template>
  <div class="box">
    <h1>Child2</h1>
    <button @click="$root.$emit('getCount',2)">修改child1的值</button>
  </div>
</template>

<script>
export default {
    name:'Child2'
}
</script>

<style scoped>
    .box{
        background: yellowgreen;
    }
</style>